<ion-header>
  <ion-toolbar class="orange-bar">
    <ion-buttons slot="start">
      <ion-button color="light" (click)="closeModal()">
        <ion-icon name="close"></ion-icon>
      </ion-button>
    </ion-buttons>
    <ion-title>{{title}}</ion-title>
    <ion-buttons slot="end">
      <ion-button color="light" (click)="presentActionSheet()">
        <ion-icon name="add"></ion-icon>
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

<ion-content>
  <ion-list *ngIf="userItems.length > 0; else nullBlock">
    <ion-list-header>
      <ion-label>
        点击缩略图可<span>预览</span>附件
      </ion-label>
    </ion-list-header>
    <ion-item *ngFor="let item of userItems">
      <ion-thumbnail slot="start" (click)="presentPopover(item['url'])">
        <img [src]="item['url']">
      </ion-thumbnail>
      <ion-label text-wrap>
        <ion-text [color]="(item['status'] | i18nSelect:configService.userItemsStatusColor)">
          {{item['status'] | i18nSelect:configService.userItemsStatus}}
        </ion-text>
      </ion-label>
      <ion-buttons slot="end">
        <ion-button *ngIf="item['status'] === 'NO_SUBMIT'" slot="end" color="primary" (click)="changeItem(item['id'], 1)">提交</ion-button>
        <ion-button *ngIf="item['status'] === 'NO_SUBMIT' || item['status'] === 'NO_PASS'" slot="end" color="danger" (click)="changeItem(item['id'], -1)">删除</ion-button>
      </ion-buttons>
    </ion-item>
  </ion-list>
  <ng-template #nullBlock>
    <ion-list>
      <ion-item><ion-label>无相关附件</ion-label></ion-item>
    </ion-list>
  </ng-template>
</ion-content>